package com.lindroy.androidplayer.base.viewmodel

import androidx.lifecycle.ViewModel
import com.lindroy.androidplayer.base.livedata.EventLiveData

/**
 * @author Lin
 * @date 2021/4/15
 * @function 基类ViewModel
 */
open class BaseViewModel : ViewModel(){
    val loadingChange: UiLoadingChange by lazy { UiLoadingChange() }
    /**
     * 内置封装好的可通知Activity/fragment 显示隐藏加载框
     */
    inner class UiLoadingChange {
        //显示加载框
        val showDialog by lazy { EventLiveData<String>() }
        //隐藏
        val dismissDialog by lazy { EventLiveData<Boolean>() }
    }
}